package com.duobaoyu.dby.supply.admin.holder;

import com.alibaba.ttl.TransmittableThreadLocal;
import com.duobaoyu.dby.supply.db.entity.message.SystemLog;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName SysLogHolder
 * @Description 日志操作AOP
 * @createTime 16:47:00 2022/06/08
 */
public class SysLogHolder {

    private static ThreadLocal<Long> timeHolder = new TransmittableThreadLocal<>();

    private static ThreadLocal<SystemLog> sysLogHolder = new TransmittableThreadLocal<>();

    public static Long getTime() {
        return timeHolder.get();
    }

    public static void setTime(Long time) {
        timeHolder.set(time);
    }

    public static void removeTime(){
        timeHolder.remove();
    }

    public static SystemLog getSystemLog() {
        return sysLogHolder.get();
    }

    public static void setSysLog(SystemLog systemLog) {
        sysLogHolder.set(systemLog);
    }

    public static void removeSysLog(){
        sysLogHolder.remove();
    }
}
